package com.gitee.mazhenggg.demo.auth.security;


import com.gitee.mazhenggg.demo.auth.entity.SysUser;
import lombok.Data;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.ToString;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;
import org.springframework.security.core.userdetails.UserDetails;

import java.util.Collection;
import java.util.Date;
import java.util.List;
import java.util.Set;


public class SecurityUserDetails extends User {
    /**
     * 用户ID
     */
    @Getter
    private Integer id;

    /**
     * 部门ID
     */
    @Getter
    private Integer deptId;

    public SecurityUserDetails(SysUser user,
                               Collection<? extends GrantedAuthority> authorities) {
        super(user.getUsername(), user.getPassword(), authorities);
    }

    public SecurityUserDetails(SysUser user, boolean enabled,
                               boolean accountNonExpired, boolean credentialsNonExpired, boolean accountNonLocked,
                               Collection<? extends GrantedAuthority> authorities) {
        super(user.getUsername(), user.getPassword(), enabled, accountNonExpired, credentialsNonExpired, accountNonLocked, authorities);
    }



}
